home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 January / PCWorld_2004-01_cd.bin / Software / temacd / guardwall / GuardIE34b314.exe / {app} / PnIE.dll / HTML / SCRIPT.JS < prev    next >
Text File  |  2003-10-10  |  3KB  |  155 lines

  1.    var color1 = 'yellow'
  2.    var color2 = '#C0C0C0'
  3.    var IeTools = null
  4.    var bReadOnly = false; 
  5.    
  6.  
  7.    function HandleError(err)
  8.    { alert("Internal error in SCRIPT.JS\n\nErrNo:  " + err.number + "\nErrMsg: " + err.description); }
  9.  
  10.    function SetColor(Color)
  11.    {
  12.      var el=event.srcElement
  13.      if (el.type == "button")
  14.        el.style.backgroundColor = Color
  15.    }
  16.     
  17.    function InitState(bLoad)
  18.    {          
  19.      for (i = 0; i < 7; i++)     
  20.      { 
  21.        try
  22.        {
  23.          Obj = document.all["C" + i];                                    
  24.  
  25.          if (bLoad == 1)                    
  26.          {
  27.            Obj.status = IeTools.Prop(Obj.name);           
  28.            Obj.disabled = bReadOnly;
  29.          }
  30.          else                
  31.            IeTools.Prop(Obj.name) = Obj.status;         
  32.        } 
  33.        catch(e)
  34.        {}
  35.        
  36.        try
  37.        {
  38.          Obj = document.all["OCX" + i];                                    
  39.  
  40.          if (bLoad == 1)                             
  41.            Obj.ReadOnly = bReadOnly;                           
  42.          else                
  43.            Obj.SaveState();
  44.        }
  45.        catch(e)
  46.        {}
  47.        
  48.        if (bReadOnly)
  49.        {
  50.          try
  51.          {
  52.            Obj = document.all["BTN" + i];                                             
  53.            Obj.disabled = true;     
  54.          }
  55.          catch(e)
  56.          {}
  57.        }
  58.      }
  59.    }
  60.  
  61.  
  62.   function OnChildKey()
  63.   {    
  64.     try
  65.     { parent.OnKey(event); }
  66.     catch(e)
  67.     {}
  68.   } 
  69.  
  70.   function OnHelp(ID)
  71.   { IeTools.ShowHelp(ID); }
  72.  
  73.   function SelSound(Name)
  74.   { 
  75.     if (!bReadOnly)
  76.      IeTools.Select(Name); 
  77.   }
  78.  
  79.  
  80.   function InitDlg()
  81.   { IeTools.InitDlg(document); }
  82.  
  83.   function DoOnlineUpdate()
  84.   {
  85.     try
  86.     {                 
  87.       parent.window.close(); 
  88.       IeTools.ShowDlg(IeTools.Prop("UpdateURL"));
  89.     }
  90.     catch(e)
  91.     { HandleError(e); }
  92.   }
  93.  
  94.  
  95.  
  96.   function OnSelectUI(Index)
  97.   {
  98.     try
  99.     {
  100.      IeTools.SelectResDll(SEL2.options[Index].value);
  101.      parent.window.close(); 
  102.     }
  103.     catch(e)
  104.     {}
  105.   }
  106.   
  107.   function InitUISelector(Obj)
  108.   {            
  109.     Obj.innerHTML = "<SELECT ID='SEL2' onchange='OnSelectUI(selectedIndex)'>" + IeTools.Prop('ResDllList'); + "</SELECT>";     
  110.     SEL2.disabled = bReadOnly;
  111.   }
  112.  
  113.  
  114.   //-----------------------------------------------------
  115.   // functions used by Prop0.htm
  116.   var CurTip=0;  
  117.   var CurDesc=0;
  118.   var nTips=0;
  119.   
  120.   function ShowTipOfDay(TipCount)
  121.   {
  122.     nTips = TipCount;
  123.     var d = new Date();    
  124.     ShowTip( (d.getMonth() * 31) + d.getDate() );        
  125.   }
  126.   
  127.   function ShowTip(TipID)
  128.   {                 
  129.     document.all["Tip" + CurTip].style.display="none";    
  130.     CurTip = TipID % nTips;    
  131.     document.all["Tip" + CurTip].style.display="block";
  132.   }  
  133.  
  134.   
  135.   function ShowDesc(Index)
  136.   {  
  137.     if ((Index >=0) & (Index <=4))
  138.     {
  139.       document.all["DESC" + CurDesc].style.display="none";
  140.       CurDesc = Index;
  141.       document.all["DESC" + CurDesc].style.display="block";
  142.     }
  143.   }  
  144.  
  145.  
  146.   //-----------------------------------------------------
  147.   // globals
  148.   IeTools = parent.window.dialogArguments;
  149.   if (IeTools==null)  
  150.   {        
  151.     IeTools = new ActiveXObject("PN.PnIETools.1")
  152.     IeTools.hWndParent = document;
  153.   }
  154.          
  155.   bReadOnly = (IeTools.Prop("RunMode") == 0);